package practice;

import java.util.Arrays;

public class StringInteger {
    public static void main(String[] args) {
        //第一遍
        //String三种方法
        String regex = "[a-zA-Z0-9]+@[a-zA-Z0-9_]+(\\.[a-zA-Z0-9]+)+";
        String address = "goodluck@baidu.com";
        boolean result = address.matches(regex);
        System.out.println(result);

        String name = "abc123def789ghi";
        String rename = name.replaceAll("[0-9]+","**");
        System.out.println(rename);

        String code = "...133..458...45....";
        String[] str = name.split("[0-9]+");
        String[] str1 = code.split("\\.");
        System.out.println(Arrays.toString(str));
        System.out.println(Arrays.toString(str1));

        //Integer
        Integer i1 = new Integer(10);
        Integer i2 = new Integer(10);
        System.out.println(i1==i2);
        System.out.println(i1.equals(i2));

        Integer i3 = Integer.valueOf(10);
        Integer i4 = Integer.valueOf(10);
        System.out.println(i3==i4);
        System.out.println(i3.equals(i4));

        int a1 = i3.intValue();
        System.out.println(a1);

        Integer i5 = 100;
        int a2 = i5;
        System.out.println(i5);
        System.out.println(a2);

        int a3 = Integer.MAX_VALUE;
        int a4 = Integer.MIN_VALUE;
        System.out.println("最大值为："+a3+",最小值为："+a4);

        String str2 = "123456";
        int a = Integer.parseInt(str2);
        System.out.println(a);

        //第二遍
        //String三种方法
//        String regex = "[a-zA-Z0-9]+@[a-zA-Z0-9_]+(\\.[a-zA-Z0-9]+)+";
//        String code = "wswfaf@1633.com";
//        boolean res = code.matches(regex);
//        System.out.println(res);
//
//        String str1 = "acc158as51asss522";
//        String str2 = str1.replaceAll("[0-9]+","***");
//        System.out.println(str2);
//
//        String str3 = "..12345..125...45......";
//        String[] str4 = str3.split("\\.");
//        System.out.println(Arrays.toString(str4));
//
//        //Integer
//        Integer i1 = new Integer(200);
//        Integer i2 = new Integer(200);
//        System.out.println(i1==i2);
//        System.out.println(i1.equals(i2));
//
//        Integer i3 = Integer.valueOf(200);
//        Integer i4 = Integer.valueOf(200);
//        System.out.println(i3==i4);
//        System.out.println(i3.equals(i4));
//
//        int m1 = i3.intValue();
//        System.out.println(m1);
//
//        Integer i5 = 100;
//        int m2 = i5;
//        System.out.println(i5);
//        System.out.println(m2);
//
//        int max = Integer.MAX_VALUE;
//        int min = Integer.MIN_VALUE;
//        System.out.println(max);
//        System.out.println(min);
//
//        String str5 = "95132";
//        int m3 = Integer.parseInt(str5);
//        System.out.println(m3);
    }
}
